package components;

import java.util.ArrayList;
import java.util.List;


public class Device extends AbstractComponent {

    private String name;

    private int password;

    private String host;

    private int port;

    private List<Function> functions;

    public Device() {}

    public Device(AbstractComponent parent) {
        super(parent);
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setPassword(int password) {
        this.password = password;
    }

    public int getPassword() {
        return password;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getHost() {
        return host;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getPort() {
        return port;
    }

    public boolean addFunction(Function function) {
        if (functions == null) {
            functions = new ArrayList<Function>();
        }
        return functions.add(function);
    }

    public List<Function> getFunctions() {
        return functions;
    }

}
